<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件处理</title>
    <script src="lib/vue.js"></script>
</head>

<body>
    <div id="box">
        <!-- handleClick带与不带()取决于是否含参数 -->
        <button @click="handleClick">显示和隐藏</button>
        <!-- 如果事件逻辑过于简单 -->
        <!-- <button @click="isShow=!isShow">click</button> -->
        <div v-show="isShow">click点击事件显示与隐藏</div>
    </div>
    <script>
        new Vue({
            el: "#box",
            data: {
                isShow: true
            },
            methods: {
                handleClick() {
                    this.isShow = !this.isShow
                }
            }
        })
    </script>
</body>

</html>